#EXTRACT WATER CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df_waterControls <- df2 %>%
filter(SampleName == "Water Control") %>%
group_by(Wavelength) %>%
summarize_at(vars(value), list(MeanAbs = mean, SdAbs = sd))
#CALCULATE THE WATER (BLANK) CORRECTED ABSORBANCE VALUES
df3 <- inner_join(df2, df_waterControls, by=c("Wavelength")) %>%
mutate(BC_value = value - MeanAbs) %>%
dplyr::select(Well_ID, SampleName, EtOH, TechRep, Wavelength, value, BC_value) %>%
filter(!SampleName %in% c("Water Control"))
#EXTRACT 0uM CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df3_Blank <- df3 %>%
filter(SampleName == "Neg Ctrl") %>%
group_by(Wavelength) %>%
summarize_at(vars(BC_value), list(BC_MeanAbs = mean, BC_SdAbs = sd))
#CALCULATE THE 0uM (REAGENT BLANK) CORRECTED ABSORBANCE VALUES
df4 <- inner_join(df3, df3_Blank, by=c("Wavelength")) %>%
mutate(NC_value = BC_value - BC_MeanAbs) %>%
dplyr::select(Well_ID, SampleName, EtOH, TechRep, Wavelength, value, BC_value, NC_value)
#COMPUTE THE AVERAGE OF TECHREPS
df5 <- df4 %>%
group_by(SampleName, EtOH, Wavelength) %>%
summarize_at(vars(NC_value), list(MeanAbs = mean, SdAbs = sd))
df5$Wavelength <- as.numeric(as.character(df5$Wavelength))
#ISOLATE THE DATA FOR THE LMAX PEAK
df5_peak <- df5 %>%
filter(Wavelength == 494 & !SampleName %in% c("Pos Ctrl", "Neg Ctrl"))
df5_pos <- df5 %>%
filter(Wavelength == 494 & SampleName == "Pos Ctrl")
df5_neg <- df5 %>%
filter(Wavelength == 494 & SampleName == "Neg Ctrl")
df5_peak$Recovery <- df5_peak$MeanAbs/df5_pos$MeanAbs
df5_peak$SampleName <- factor(df5_peak$SampleName, levels = c("Blank Extract", "Im Extract", "E150D+Im Extract"))
#PLOT DATA - 494 NM
pal <- brewer.pal(6, "Blues")
ggplot(df5_peak, aes(x=as.numeric(EtOH), y=MeanAbs, color=SampleName)) +
geom_line(aes(linetype=SampleName)) +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.5) +
scale_y_continuous(breaks = seq(0, 0.5, by = 0.1), limits = c(-0.01,0.5)) +
labs(x = "Sample [EtOH] (%)",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[3], pal[3], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
scale_linetype_discrete(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)")) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE),
linetype=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.numeric(EtOH), y=MeanAbs, color=SampleName)) +
geom_line(aes(linetype=SampleName)) +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.5) +
scale_y_continuous(breaks = seq(0, 0.5, by = 0.1), limits = c(-0.01,0.5)) +
labs(x = "Sample [EtOH] (%)",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[3], pal[3], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
scale_linetype_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values=c("solid", "dashed", "dashed")) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE),
linetype=guide_legend(byrow=TRUE))
#PRINT/SAVE IMAGES, CHANGE FILE NAMES AS APPROPRIATE
ggsave("SALLE_EtOH_494_2.pdf", height=13, width=13, units="cm", device = cairo_pdf)
#Load libraries
setwd(dirname(rstudioapi::getSourceEditorContext()$path)) #path is where this code is saved - data must be in the same folder
library(readxl)
library(dplyr)
library(reshape)
library(ggplot2)
library(RColorBrewer)
#library(scales)
#OPEN FILES
df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Plate 1 Transposed')
name_df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Sample Names')
#RENAME FIRST COLUMN
names(df)[1]<-"Well_ID"
#MERGE NAMES_DF WITH MAIN DATAFRAME
df1 <- cbind(name_df, df[!names(df) %in% names(name_df)])
#WHERE THE INDIVIDUAL SPECTRA ARE IN COLUMNS, STACK THE DATA
df2 <- melt(df1, id=c("Well_ID", "SampleName", "pH", "TechRep"))
names(df2)[names(df2) == "variable"] <- "Wavelength"
df2$value = as.numeric(df2$value)
#EXTRACT WATER CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df_waterControls <- df2 %>%
filter(SampleName == "Water Control") %>%
group_by(Wavelength) %>%
summarize_at(vars(value), list(MeanAbs = mean, SdAbs = sd))
#CALCULATE THE WATER (BLANK) CORRECTED ABSORBANCE VALUES
df3 <- inner_join(df2, df_waterControls, by=c("Wavelength")) %>%
mutate(BC_value = value - MeanAbs) %>%
dplyr::select(Well_ID, SampleName, pH, TechRep, Wavelength, value, BC_value) %>%
filter(!SampleName %in% c("Water Control"))
#EXTRACT 0uM CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df3_Blank <- df3 %>%
filter(SampleName == "Neg Ctrl") %>%
group_by(Wavelength) %>%
summarize_at(vars(BC_value), list(BC_MeanAbs = mean, BC_SdAbs = sd))
#CALCULATE THE 0uM (REAGENT BLANK) CORRECTED ABSORBANCE VALUES
df4 <- inner_join(df3, df3_Blank, by=c("Wavelength")) %>%
mutate(NC_value = BC_value - BC_MeanAbs) %>%
dplyr::select(Well_ID, SampleName, pH, TechRep, Wavelength, value, BC_value, NC_value)
#COMPUTE THE AVERAGE OF TECHREPS
df5 <- df4 %>%
group_by(SampleName, pH, Wavelength) %>%
summarize_at(vars(NC_value), list(MeanAbs = mean, SdAbs = sd))
df5$Wavelength <- as.numeric(as.character(df5$Wavelength))
#ISOLATE THE DATA FOR THE LMAX PEAK
df5_peak <- df5 %>%
filter(Wavelength == 494 & !SampleName %in% c("Pos Ctrl", "Neg Ctrl"))
df5_pos <- df5 %>%
filter(Wavelength == 494 & SampleName == "Pos Ctrl")
df5_neg <- df5 %>%
filter(Wavelength == 494 & SampleName == "Neg Ctrl")
df5_peak$Recovery <- df5_peak$MeanAbs/df5_pos$MeanAbs
df5_peak$SampleName <- factor(df5_peak$SampleName, levels = c("Blank Extract", "Im Extract", "E150D+Im Extract"))
#PLOT DATA - 494 NM
pal <- brewer.pal(6, "Blues")
ggplot(df5_peak, aes(x=as.numeric(pH), y=MeanAbs, color=SampleName)) +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.numeric(pH), y=MeanAbs, color=SampleName)) +
geom_line(aes(linetype=SampleName)) +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.numeric(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=pH, y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
View(df5_peak)
View(df4)
View(df)
View(df1)
#Load libraries
setwd(dirname(rstudioapi::getSourceEditorContext()$path)) #path is where this code is saved - data must be in the same folder
library(readxl)
library(dplyr)
library(reshape)
library(ggplot2)
library(RColorBrewer)
#library(scales)
#OPEN FILES
df <- read_excel('Exp 20250804 - Optimization of SALLE Extraction Pt2.xlsx','Plate 1 Transposed')
name_df <- read_excel('Exp 20250804 - Optimization of SALLE Extraction Pt2.xlsx','Sample Names')
#RENAME FIRST COLUMN
names(df)[1]<-"Well_ID"
#MERGE NAMES_DF WITH MAIN DATAFRAME
df1 <- cbind(name_df, df[!names(df) %in% names(name_df)])
#WHERE THE INDIVIDUAL SPECTRA ARE IN COLUMNS, STACK THE DATA
df2 <- melt(df1, id=c("Well_ID", "SampleName", "Conc", "TechRep"))
names(df2)[names(df2) == "variable"] <- "Wavelength"
df2$value = as.numeric(df2$value)
#EXTRACT WATER CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df_waterControls <- df2 %>%
filter(SampleName == "Water Control") %>%
group_by(Wavelength) %>%
summarize_at(vars(value), list(MeanAbs = mean, SdAbs = sd))
#CALCULATE THE WATER (BLANK) CORRECTED ABSORBANCE VALUES
df3 <- inner_join(df2, df_waterControls, by=c("Wavelength")) %>%
mutate(BC_value = value - MeanAbs) %>%
dplyr::select(Well_ID, SampleName, Conc, TechRep, Wavelength, value, BC_value) %>%
filter(!SampleName %in% c("Water Control"))
#EXTRACT 0uM CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df3_Blank <- df3 %>%
filter(SampleName == "Neg Ctrl") %>%
group_by(Wavelength) %>%
summarize_at(vars(BC_value), list(BC_MeanAbs = mean, BC_SdAbs = sd))
#CALCULATE THE 0uM (REAGENT BLANK) CORRECTED ABSORBANCE VALUES
df4 <- inner_join(df3, df3_Blank, by=c("Wavelength")) %>%
mutate(NC_value = BC_value - BC_MeanAbs) %>%
dplyr::select(Well_ID, SampleName, Conc, TechRep, Wavelength, value, BC_value, NC_value)
#COMPUTE THE AVERAGE OF TECHREPS
df5 <- df4 %>%
group_by(SampleName, Conc, Wavelength) %>%
summarize_at(vars(NC_value), list(MeanAbs = mean, SdAbs = sd))
df5$Wavelength <- as.numeric(as.character(df5$Wavelength))
#ISOLATE THE DATA FOR THE LMAX PEAK
df5_peak <- df5 %>%
filter(Wavelength == 494 & !SampleName %in% c("Pos Ctrl", "Neg Ctrl"))
df5_pos <- df5 %>%
filter(Wavelength == 494 & SampleName == "Pos Ctrl")
df5_neg <- df5 %>%
filter(Wavelength == 494 & SampleName == "Neg Ctrl")
df6_peak <- cbind(str_split_fixed(df5_peak$SampleName, " ", 2), df5_peak[2:5])
names(df6_peak)[1:2]<-c("SampleName","ExpRep")
df6_peak$Recovery <- df6_peak$MeanAbs/df5_pos$MeanAbs
df6_peak$SampleName <- factor(df6_peak$SampleName, levels = c("Blank", "Im", "E150D", "E150D:Im"))
View(df6_peak)
#Load libraries
setwd(dirname(rstudioapi::getSourceEditorContext()$path)) #path is where this code is saved - data must be in the same folder
library(readxl)
library(dplyr)
library(reshape)
library(ggplot2)
library(RColorBrewer)
#library(scales)
#OPEN FILES
df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Plate 1 Transposed')
name_df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Sample Names')
#RENAME FIRST COLUMN
names(df)[1]<-"Well_ID"
View(name_df)
#Load libraries
setwd(dirname(rstudioapi::getSourceEditorContext()$path)) #path is where this code is saved - data must be in the same folder
library(readxl)
library(dplyr)
library(reshape)
library(ggplot2)
library(RColorBrewer)
#library(scales)
#OPEN FILES
df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Plate 1 Transposed')
name_df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Sample Names')
#RENAME FIRST COLUMN
names(df)[1]<-"Well_ID"
View(name_df)
#Load libraries
setwd(dirname(rstudioapi::getSourceEditorContext()$path)) #path is where this code is saved - data must be in the same folder
library(readxl)
library(dplyr)
library(reshape)
library(ggplot2)
library(RColorBrewer)
#library(scales)
#OPEN FILES
df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Plate 1 Transposed')
name_df <- read_excel('Exp 20251103 - Effects of pH on SALLE-CIPS.xlsx','Sample Names')
#RENAME FIRST COLUMN
names(df)[1]<-"Well_ID"
#MERGE NAMES_DF WITH MAIN DATAFRAME
df1 <- cbind(name_df, df[!names(df) %in% names(name_df)])
#WHERE THE INDIVIDUAL SPECTRA ARE IN COLUMNS, STACK THE DATA
df2 <- melt(df1, id=c("Well_ID", "SampleName", "pH", "TechRep"))
names(df2)[names(df2) == "variable"] <- "Wavelength"
df2$value = as.numeric(df2$value)
#EXTRACT WATER CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df_waterControls <- df2 %>%
filter(SampleName == "Water Control") %>%
group_by(Wavelength) %>%
summarize_at(vars(value), list(MeanAbs = mean, SdAbs = sd))
#CALCULATE THE WATER (BLANK) CORRECTED ABSORBANCE VALUES
df3 <- inner_join(df2, df_waterControls, by=c("Wavelength")) %>%
mutate(BC_value = value - MeanAbs) %>%
dplyr::select(Well_ID, SampleName, pH, TechRep, Wavelength, value, BC_value) %>%
filter(!SampleName %in% c("Water Control"))
#EXTRACT 0uM CONTROLS AND COMPUTE THE AVERAGE OF TECHREPS
df3_Blank <- df3 %>%
filter(SampleName == "Neg Ctrl") %>%
group_by(Wavelength) %>%
summarize_at(vars(BC_value), list(BC_MeanAbs = mean, BC_SdAbs = sd))
#CALCULATE THE 0uM (REAGENT BLANK) CORRECTED ABSORBANCE VALUES
df4 <- inner_join(df3, df3_Blank, by=c("Wavelength")) %>%
mutate(NC_value = BC_value - BC_MeanAbs) %>%
dplyr::select(Well_ID, SampleName, pH, TechRep, Wavelength, value, BC_value, NC_value)
#COMPUTE THE AVERAGE OF TECHREPS
df5 <- df4 %>%
group_by(SampleName, pH, Wavelength) %>%
summarize_at(vars(NC_value), list(MeanAbs = mean, SdAbs = sd))
df5$Wavelength <- as.numeric(as.character(df5$Wavelength))
#ISOLATE THE DATA FOR THE LMAX PEAK
df5_peak <- df5 %>%
filter(Wavelength == 494 & !SampleName %in% c("Pos Ctrl", "Neg Ctrl"))
df5_pos <- df5 %>%
filter(Wavelength == 494 & SampleName == "Pos Ctrl")
df5_neg <- df5 %>%
filter(Wavelength == 494 & SampleName == "Neg Ctrl")
df5_peak$Recovery <- df5_peak$MeanAbs/df5_pos$MeanAbs
df5_peak$SampleName <- factor(df5_peak$SampleName, levels = c("Blank Extract", "Im Extract", "E150D+Im Extract"))
View(df5_peak)
df5_peak$pH <- round(df5_peak$pH, digits =1)
df5_peak$pH <- ifelse(
suppressWarnings(!is.na(as.numeric(df5_peak$pH))),
round(as.numeric(df5_peak$pH), 1),
df5_peak$pH
)
#PLOT DATA - 494 NM
pal <- brewer.pal(6, "Blues")
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
View(df5)
#ISOLATE THE DATA FOR THE LMAX PEAK
df5_peak <- df5 %>%
filter(Wavelength == 494 & !SampleName %in% c("Pos Ctrl", "Neg Ctrl", "Blank Extract"))
df5_pos <- df5 %>%
filter(Wavelength == 494 & SampleName == "Pos Ctrl")
df5_neg <- df5 %>%
filter(Wavelength == 494 & SampleName == "Neg Ctrl")
df5_peak$Recovery <- df5_peak$MeanAbs/df5_pos$MeanAbs
df5_peak$SampleName <- factor(df5_peak$SampleName, levels = c("Blank Extract", "Im Extract", "E150D+Im Extract"))
df5_peak$pH <- ifelse(
suppressWarnings(!is.na(as.numeric(df5_peak$pH))),
round(as.numeric(df5_peak$pH), 1),
df5_peak$pH
)
#PLOT DATA - 494 NM
pal <- brewer.pal(6, "Blues")
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(aes(shape=SampleName), size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(shape=17, color=pal[5], size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs), color=SampleName), width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
#scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
#scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_line(linetype="dashed") +
geom_point(shape=17, color=pal[5], size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs)), color=pal[5], width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
#scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
#scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
ggplot(df5_peak, aes(x=as.factor(pH), y=MeanAbs, color=SampleName)) +
geom_point(shape=17, color=pal[5], size = 4) +
geom_errorbar(aes(ymin=(MeanAbs - SdAbs), ymax=(MeanAbs + SdAbs)), color=pal[5], width = 0.05) +
scale_y_continuous(breaks = seq(0, 0.4, by = 0.1), limits = c(-0.01,0.4)) +
labs(x = "Sample pH",
y = "Δ Absorbance 494 nm (a.u.)") +
theme_classic() +
theme(aspect.ratio=1,
axis.title=element_text(size=18),
axis.text=element_text(color = 1, size = 14),
legend.title=element_blank(),
legend.justification=c(0,1),
legend.position=c(0.05,1),
legend.text=element_text(size = 14),
legend.background = element_blank(),
panel.border = element_rect(colour = "black", fill=NA)) +
#scale_color_manual(values = c(pal[5], pal[5]), labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole", "50 \U003BCM Imidazole + E150D (0.2%)")) +
#scale_shape_manual(labels=c("0 \U003BCM Imidazole", "50 \U003BCM Imidazole","50 \U003BCM Imidazole + E150D (0.2%)"), values = c(16,17,17)) +
guides(color=guide_legend(byrow=TRUE),
shape=guide_legend(byrow=TRUE))
#PRINT/SAVE IMAGES, CHANGE FILE NAMES AS APPROPRIATE
ggsave("SALLE_pH_494.pdf", height=13, width=13, units="cm", device = cairo_pdf)
